From: robertl Date: Sat, 13 Mar 2010 17:53:04 +0000 (+0000) Subject: Whack extension from Bushenell waypoints if given. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~199^2~39 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a733559d5df9bafd4ffdad7bc3ee765cdb7ab90e;p=gpsbabel.git Whack extension from Bushenell waypoints if given. --- diff --git a/bushnell.c b/bushnell.c index 2452975ce..5bcdea821 100644 --- a/bushnell.c +++ b/bushnell.c @@ -24,7 +24,7 @@ #define MYNAME "Bushnell" static gbfile *file_in; -static const char *ofname; +static char *ofname; static short_handle mkshort_handle = NULL; static @@ -157,7 +157,14 @@ rd_deinit(void) { static void wr_init(const char *fname) { - ofname = fname; + char *dot; + + ofname = xstrdup(fname); + + // If user provided an extension, whack it. + dot = strchr(ofname, '.'); + if (dot) *dot = 0; + static char valid_chars [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789" ".-/\\~@#$%^&*()_+=<>" "abcdefghijklmnopqrstuvwxyz"; @@ -170,7 +177,7 @@ wr_init(const char *fname) { static void wr_deinit(void) { mkshort_del_handle(&mkshort_handle); - + xfree(ofname); } /*